from constant import *


class ZombieMessage:
    def __init__(self, name: str, zombie_property: str, zombie, zombie_path: str, pace: str | int, dmg: int):
        self.name = name
        self.property = zombie_property
        self.zombie = zombie
        self.zombie_path = zombie_path
        self.pace = pace if isinstance(pace, int) else ZOMBIES_PACE[pace]
        self.dmg = dmg


class ZombieObject(GifObject):
    def __init__(self, screen: pg.Surface, zombie: ZombieMessage, row):
        super().__init__(screen, zombie.zombie_path)
        self.row = row
        self.dmg = zombie.dmg
        self.trajectory = points_trajectory((SCREEN_WIDTH - 120, row * LAWN_HEIGHT),
                                            (20, row * LAWN_HEIGHT), zombie.pace)


class Zombie(ZombieObject):
    def __init__(self, screen: pg.Surface, row):
        zombie = ZombieMessage('Zombie', 'grassland', Zombie, 'images\\Zombies\\Zombie\\Zombie.gif', '正常', 10)
        super().__init__(screen, zombie, row)
